﻿using System;
using System.Collections.Generic;

public class BarrelComparer : IComparer<Barrel>
{
    public int Compare(Barrel barrelA, Barrel barrelB)
    {
        if (barrelA == barrelB)
        {
            return 0;
        }
        if (barrelA.Position.Y <= barrelB.Position.Y)
        {
            return -1;
        }
        return 1;
    }
}